<?php
class Default_Form_PictureUploader extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');

        $this->setAttrib('enctype', 'multipart/form-data');

        $element = new Zend_Form_Element_File('foo');
        $element->setLabel('Upload an image:');
        // ensure only 1 file
        $element->addValidator('Count', false, 1);
        // limit to 100K
        $element->addValidator('Size', false, 2042000);
        // only JPEG, PNG, and GIFs
        $element->addValidator('Extension', false, 'jpg,png,gif');

        $this->addElement($element, 'foo');

        $this->addElement('submit', 'submit', array(
            'label'    => 'Upload',
        ));
    }
}
